{% extends "../_shared/base.html" %}

{% block first_column %}
{% if two_columns %}
<div id="twoCol" class-"fix"><a name="main"></a>
{% else %}
<div id="mainCol" class="fix"><a name="main"></a>
{% endif %}
{% if article %}
    <div id="article" class="post">
        <div class="postMeta">
            {% if user_is_admin %}
            <span class="articlebtn"><a id="editbtn" href="#">Edit</a></span>
            <span class="articlebtn"><a id="deletebtn" href="#">Delete</a></span>
            {% endif %}
            <span class="date">{{ article.published.date }}</span>
            <span class="comments"><a href="/{{ article.permalink }}#comments">{{ article.num_comments|default:"0" }}</a></span>
        </div>
        <h2><a id="blogtitle" href="/{{ article.permalink }}" title="{{ article.title }}">{{ article.title }}</a></h2>
        <div id="blogbody" class="entry">
            {{ article.html }}
        </div>
    </div>
    <div id="more_reading">
        <p class="tags">Category: 
            {% for tag in article.tags %}
                <a href="/tag/{{ tag|urlencode }}">{{ tag }}</a>
            {% endfor %}
        </p>
    </div>
{% else %}
    <div class="post">
        <div class="postMeta"><span class="date">No Matches</span></div>
        <h2>No Article at Given Address</h2>
        <div class="entry">
            <p>You seem to have found a mis-linked page or search query with no associated results.</p>
            <p>Please trying your search again. 
                If you feel that you should be staring at something a little more concrete, feel free to email the author of this site 
                or browse the archives.</p>
        </div>
    </div>
{% endif %}
    <div id="comments_wrapper">
        <a class="replybtn" href="#">Add a comment...</a>
        <div id="comments" class="section">
            <h3><span id="num_comments">{{ article.num_comments }}</span> Comments</h3>
            <ol id="commentslist">
            {% for comment in article.comments %}
            {% include "comment.html" %}
            {% endfor %}
            </ol>
        </div>
    </div>
</div>
{% endblock %}

{% block end_body %}
{% include "../_shared/form_comment.html" %}
{% endblock %}

